package study.nosql.redis.support.redis;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.BoundListOperations;
import org.springframework.data.redis.core.BoundSetOperations;
import org.springframework.data.redis.core.BoundStreamOperations;
import org.springframework.data.redis.core.RedisTemplate;

@Configuration
public class QueueConfig {

    @Autowired
    private RedisTemplate redisTemplate;

    @Bean
    public BoundListOperations<String, String> listQueue() {
        return redisTemplate.boundListOps("queue:list_test");
    }

    @Bean
    public BoundSetOperations<String, String> setQueue() {
        redisTemplate.opsForSet();
        return redisTemplate.boundSetOps("queue:set_test");
    }

    @Bean
    public BoundStreamOperations<String, String, Object> streamQueue() {
        return redisTemplate.boundStreamOps("queue:stream_test");
    }
}
